

# 一般在app中新建urls, 在子路由中匹配路由
from django.conf.urls import  url
from myApp import views

app_name = "myApp"

urlpatterns = [
#     路由匹配
    url(r'index/',views.index,name="myIndex"),

    # url(r'marketRef/',views.marketRef),
    url(r'marketRefNew/(\d+)$', views.marketRef, name="nameMarketRef"),

    url(r'detail/(\d+)',views.detail),

#   学生信息
    url(r'students/$',views.student),
#   班级信息
    url(r'grades/',views.grade),

#   通过学生看班级
    url(r'students/grade/(\d+)/',views.gradeByStudent),
#  增加一个学生
    url(r'addStudent/',views.addStudent),


#  查看
    url(r'findPerson/(\d+)/',views.findPerson),
    # url(r'findIdCard/',views.findPerson),

#  增加身份证好人
    url(r'addIdCard/(\d+)/',views.addIdcard),
    url(r'addPerson/(\d+)/',views.addPerson),
 #  删除身份证好人
    url(r'delIdCard/(\d+)/',views.delIdCard),
    url(r'delPerson/(\d+)/',views.delPerson),

#  多对多
    url(r'addProduct/(\w+)/(\d+)/',views.addProduct),
    url(r'addBuyer/(\w+)/(\d+)/',views.addBuyer),
    url(r'pTob/(\w+)/(\w+)/',views.pTob),


    url(r'test/(\d+)/$',views.test),
    url(r'get1/$',views.get1),
    url(r'get2/$',views.get2),
    url(r'testRegiste/$',views.testRegiste),

    url(r"^$",views.originRedirectLogin),

    url(r'^homePage/$',views.homeFunc),
    url(r'^homeChildPage/$',views.homeChildFunc),
    url(r'^loginPage/$',views.loginFunc),
    url(r'^logoutPage/$',views.logoutFunc),


#  继承
    url(r'^child1/$', views.child1),
    url(r'^child2/$', views.child2),
    url(r'^child3/$', views.child3),


# 验证码
    url(r'^verifycode/$',views.verifycodeFunc),

# 上传文件
    url(r'^upfile/$',views.upfileFunc),

# 分页器
    url(r'^pageStudent/(\d+)/$', views.pageStudentFunc),

# ajax
    url(r'^ajax_allStudents/$', views.ajax_allStudentFunc),

#  富文本
    url(r'^tinymce/$', views.tinymce),

# celery
    url(r'^celeryRegister/$', views.celeryRegister),

# sendEmail
    url(r'^sendEmail/$',views.sendEmailFunc),
    url(r'^checkUser/$', views.checkUser),


#  restful
    url(r'^studentsRestful/$', views.studentsList),   #  /$  注意url的最后要有 / 不然报错!
    url(r'^studentsRestful/(?P<pk>\d+)/$', views.studentsListDetail),

    # restful 的请求和响应
    url(r'^studentsRestfulReqRes/$', views.studentsListReqRes),
    url(r'^studentsRestfulReqRes/(?P<pk>\d+)/$', views.studentsListDetailReqRes),

    # 使用类视图:
    url(r'^studentsRestfulClass/$', views.StudentsListClass.as_view()),
    url(r'^studentsRestfulClass/(?P<pk>\d+)/$', views.StudentsListDetailClass.as_view()),

    url(r'^studentsRestfulClassMixin/$', views.StudentListMixin.as_view()),
    url(r'^studentsRestfulClassMixin/(?P<pk>\d+)/$', views.StudentListDetailMixin.as_view()),
    # 究极继承:
    url(r'^studentsRestfulClassgenerics/$', views.StudentsListSimplied.as_view()),
    url(r'^studentsRestfulClassgenerics/(?P<pk>\d+)/$', views.StudentListDetailSimplied.as_view()),

]

from rest_framework.urlpatterns import format_suffix_patterns
# # 添加格式后缀:
urlpatterns = format_suffix_patterns(urlpatterns)








